﻿/**********************************************************************
 * @file   FITKAcousticsVTKGraphObjectSensor.h
 * @brief  传感器可视化对象
 * @author BaGuijun (baguijun@163.com)
 * @date   2025-01-13
 *********************************************************************/
#ifndef FITKAcousticsVTKGraphObjectSensor_H_
#define FITKAcousticsVTKGraphObjectSensor_H_

#include "FITKAcousticsVTKGraphAdaptorAPI.h"
#include "FITKAcousticsVTKGraphObject3D.h"

namespace Acoustics {
    class FITKAcousticsSensors;
}

class FITKAcousticsVTKGraphActor;
class vtkArrowSource;
class vtkGlyph3D;
class vtkPoints;
class vtkPolyData;
class vtkDoubleArray;

namespace Exchange
{
    /**
     * @brief  传感器可视化对象
     * @author BaGuijun (baguijun@163.com)
     * @date   2025-01-13
     */
    class FITKACOUSTICSGRAPHADAPTORAPI FITKAcousticsVTKGraphObjectSensor : public FITKAcousticsVTKGraphObject3D
    {
        FITKGraphObjectRegist(FITKAcousticsVTKGraphObjectSensor, FITKAcousticsVTKGraphObject3D);
        FITKCLASS(Exchange, FITKAcousticsVTKGraphObjectSensor);
    public:
        /**
         * @brief    构造函数
         * @param[i] sensor              传感器数据 
         * @author   BaGuijun (baguijun@163.com)
         * @date     2025-01-13
         */
        FITKAcousticsVTKGraphObjectSensor(Acoustics::FITKAcousticsSensors* sensor);
        /**
         * @brief    析构函数
         * @author   BaGuijun (baguijun@163.com)
         * @date     2025-01-13
         */
        virtual ~FITKAcousticsVTKGraphObjectSensor();
        /**
         * @brief    获取数据是否可见
         * @return   bool             是否可见
         * @author   BaGuijun (baguijun@163.com)
         * @date     2024-12-19
         */
        bool getDataVisibility() override;
        /**
         * @brief    刷新重写
         * @param[i] forceUpdate        是否强制刷新
         * @author   BaGuijun (baguijun@163.com)
         * @date     2024-12-16
         */
        virtual void update(bool forceUpdate = false) override;
        /**
         * @brief    设置拾取模式
         * @param[i] mode                  模式
         * @author   BaGuijun (baguijun@163.com)
         * @date     2024-12-19
         */
        virtual void setPickMode(FITKAcousticsVTKCommons::ShapePickMode mode) override;
        /**
         * @brief    高亮渲染对象
         * @param[i] hightObjID                     高亮数据id【仅复合数据使用】
         * @param[i] type                           需要突出显示形状类型
         * @param[i] color                          高亮颜色
         * @author   BaGuijun (baguijun@163.com)
         * @date     2025-02-05
         */
        void highlight(int hightObjID = -1, FITKAcousticsVTKCommons::ShapeType type = FITKAcousticsVTKCommons::ShapeTypeNone, QColor color = QColor()) override;
        /**
         * @brief    取消高亮渲染对象
         * @param[i] hightObjID                     取消高亮数据id【仅复合数据使用】
         * @author   BaGuijun (baguijun@163.com)
         * @date     2025-02-05
         */
        void disHighlight(int hightObjID = -1) override;
    protected:
        /**
         * @brief    初始化
         * @return   void
         * @author   BaGuijun (baguijun@163.com)
         * @date     2024-12-19
         */
        void init();
        /**
         * @brief    数据生成
         * @return   bool                是否成功
         * @author   BaGuijun (baguijun@163.com)
         * @date     2025-01-13
         */
        bool generateDataSet();
        /**
         * @brief    渲染对象生成
         * @author   BaGuijun (baguijun@163.com)
         * @date     2025-01-13
         */
        void generateGraph();
    protected:
        /**
         * @brief  演员对象
         * @author BaGuijun (baguijun@163.com)
         * @date   2025-01-13
         */
        FITKAcousticsVTKGraphActor* _graphActor = nullptr;
        /**
         * @brief  箭头几何数据
         * @author BaGuijun (baguijun@163.com)
         * @date   2024-12-19
         */
        vtkArrowSource* _picData = nullptr;
        /**
         * @brief  图元
         * @author BaGuijun (baguijun@163.com)
         * @date   2024-12-24
         */
        vtkGlyph3D* _glyph3D = nullptr;
        /**
         * @brief  箭头位置
         * @author BaGuijun (baguijun@163.com)
         * @date   2024-12-24
         */
        vtkPoints* _points = nullptr;
        /**
         * @brief  箭头数据
         * @author BaGuijun (baguijun@163.com)
         * @date   2024-12-24
         */
        vtkPolyData* _polydata = nullptr;
        /**
         * @brief  箭头方向
         * @author BaGuijun (baguijun@163.com)
         * @date   2024-12-24
         */
        vtkDoubleArray* _directions = nullptr;
    };
}

#endif
